ZonesClone

Clone the Table Structure

Request address

POST
http://OmsAddress/app/newoms.php/webservice/business/zones/clone?cmd=10006&ip-type=webservicerest&access-token=AccessTokenVal

POST request parameter description

Parameter name Data type Description Whether the field is required Remarks
src_app_id integer app id of the cloned source table Yes
src_zone_id integer zone id of the cloned source table Yes
table_info Array This is the information of the cloned source table. It supports cloning multiple tables. The table information structure is as follows: table_name: table_name of the source table, string, required Yes
dest_app_id integer app id of the designated game zone of the cloning table Yes
dest_zone_id integer zone id of the designated game zone of the cloning table Yes

Data Parameters

Use json format to represent the record related information. The following is an example:

{
    "src_app_id": 2,
    "src_zone_id": 3,
    "table_info": [
        {
            "table_name": "tb_online_list"
        }
    ],
    "dest_app_id": 2,
    "dest_zone_id": 4
}

Return Syntax

Return Parameter Description

  1. When the returned status code is not 200, it indicates that the addition was unsuccessful, and the returned data is error information

  2. When the returned status code is 200, it means the transaction was successful, where success means the information of the zone that was successfully deleted, and failed means the information of the zone that failed to be deleted.

Request Example

Send A Request through the Curl Method

For the parameters in the command, please refer to the "Description of POST Request Parameters" on this page. For the method to obtain access-token, see: Get access-token

curl -H "Content-type: application/json" -X "POST" -d '{
    "src_app_id": 2,
    "src_zone_id": 3,
    "table_info": [
        {
            "table_name": "tb_online_list"
        }
    ],
    "dest_app_id": 2,
    "dest_zone_id": 4
}' http://omsaddress/app/newoms.php/webservice/business/zones/clone?cmd=10006&ip-type=webservicerest&access-token=\

Return Example

Successful Return Example

When the Status of the http request is 200, it only needs to get the id (application form id) in the info message and check whether app_id、zone_list、table_name are matched. Other fields do not need to be paid attention to. They are the same as the clone source.

[
    {
        "id": 215,
        "kelly_id": 0,
        "set_id": 1,
        "app_id": 2,
        "app_name": "app_2",
        "zone_list": "4",
        "user": "tcaplus",
        "job_id": "",
        "table_name": "tb_online_list",
        "table_type": 1,
        "table_maxnum": 234,
        "estimated_volume": 0,
        "estimated_avarage_record_size": 0,
        "estimated_write_load": 1,
        "estimated_read_load": 1,
        "type": "proto",
        "key_struct": "",
        "value_struct": "",
        "write_time": "2021-02-08 17:55:15",
        "memo": "Clone table from app(2) zone(3)",
        "attention_man": "",
        "dm_ratio": 0,
        "execute_user": "",
        "execute_status": 0,
        "audit_memo": "",
        "task_id": "",
        "cu_list": "",
        "machine_choose": "",
        "version": "",
        "hash_mode": 0,
        "tdr": "21,20",
        "apply_type": 0,
        "engine_parameters": "bnum=1900000#xmsiz=250000000#xikmsiz=141000000#kmapow=6#kfapow=6#vmapow=6#vfapow=6#lnum=2",
        "key_avarage_record_size": 1,
        "value_avarage_record_size": 1,
        "compress": 1,
        "active_record_num": "1",
        "total_record_num": "1",
        "trans_id": "",
        "calc_resource_type": 1,
        "pcu": 0,
        "relationship_chain_interval": 0,
        "relationship_chain_count": 0,
        "index_count": 0,
        "read_index_interval": 0,
        "read_index_count": 0,
        "read_interval": 0,
        "write_interval": 0,
        "max_read_rate": 0,
        "max_write_rate": 0,
        "exceed_times": 0,
        "idl_md5": null,
        "resource_ratio": 1,
        "ext_idl_md5": null,
        "ext_zone_id": null,
        "ext_info": null,
        "moa_push_status": 0,
        "moa_process_id": "",
        "sort_field_num": 0,
        "sort_rule": 0,
        "data_protocol_type": "TBD"
    }
]

Failed Return Example

Status of http request != 200

[
    "can not find src table list:app:2,zone:3,table name list:tb_online_list_1"
]

results matching ""

    No results matching ""